<?php
require_once('conn.inc.php');
@$conn		=		mysql_connect($db_host,$db_user,$db_pwd);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);

@$select	=	"select * from home where flag like '%h%' &&  state='1' order by id asc LIMIT 0,3";
$result = mysql_query($select);
$results = array();
while ($xx = mysql_fetch_assoc($result)) {
	$results[] = $xx;
}
// 将数组转成json格式
echo json_encode($results);
mysql_close();
